package com.zero.config.client.controller;

import com.zero.config.client.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableConfigurationProperties(User.class)
public class UserController {

    /**
     * 构造器注入
     */
    private final User user;

    @Autowired
    public UserController(User user) {
        this.user = user;
    }

    @RequestMapping("/user")
    public User getUser(){
        return user;
    }
}
